/**
* @file      test_relay.c
* @author    Supachai Vorapojpisut
* @version   0.1
* @date      November 4, 2014
* @brief     Test code for relay module
*/

/* Includes -----------------------------------------------------------------------*/
#include "relay.h"
#include "util.h"
int PIN;

/* Private types ------------------------------------------------------------------*/
/* Private constants --------------------------------------------------------------*/
/* Private macro ------------------------------------------------------------------*/
/* Private variables --------------------------------------------------------------*/
/* Private function prototypes ----------------------------------------------------*/
/* Private functions --------------------------------------------------------------*/


/**
* @brief    Turn ON and OFF channel 1 and 5 every 1 second
*/
void realy_changeAndStatus(unsigned int ROOM_NO){
	
	switch (ROOM_NO)
	{
		case 'A' : PIN = 13; break;
		case 'B' : PIN = 12; break;
		case 'C' : PIN = 8; break;
		case 'D' : PIN = 7; break;
		case 'E' : PIN = 4; break;
		case 'F' : PIN = 3; break;
		case 'G' : PIN = 2; break;
		case 'H' : PIN = 5; break;
		default : PIN = 1; break;
	}
}

	int main()
	
{
    uint8_t activate_relay = RELAY_CH1| RELAY_CH2 | RELAY_CH3 | RELAY_CH4 | RELAY_CH5 | RELAY_CH6 | RELAY_CH7 | RELAY_CH8;
    
    relay_config(activate_relay);
    timebase_config();
    
    while(1) {
        relay_turn_on(RELAY_CH1| RELAY_CH2 | RELAY_CH3 | RELAY_CH4 | RELAY_CH5 | RELAY_CH6 | RELAY_CH7 | RELAY_CH8);
        delay(1000);
        relay_turn_off(RELAY_CH1);
        delay(1000);
        relay_turn_off(RELAY_CH5);
        
			 
			
    }
	}